<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>分公司审核记录列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../res/layui-v2.5.6/css/layui.css" media="all">
    <script type="text/javascript" src="../../../res/js/jquery-3.4.1.min.js"></script>
</head>
<body>
<table class="layui-hide" id="test" lay-filter="test"></table>

<script type="text/javascript" src="../../../res/layui-v2.5.6/layui.js"></script>
<script>
    var openIndex = null;
    var table = null;
    var laydate = null;
    layui.use(['table', 'laydate'], function () {
        table = layui.table;
        laydate = layui.laydate;

        table.render({
            method:"POST",
            elem: '#test'
            , url: '/auditRecord/showList'
            , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            , defaultToolbar: false
            , title: '分公司审核记录数据表'
            , cols: [[
                //{type: 'checkbox', fixed: 'left'},
                 {field: 'id', title: '审核记录ID', width: 140,fixed: 'left'}
                , {field: 'opertime', title: '操作时间', width: 170,align:"center"}
                , {field: 'isva', title: '审核状态', width: 170,align:"center",templet:function(d){
                        if(d.isva == '10'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">未申请</p>';
                        } else if(d.isva == '20'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">已申请</p>';
                        }else if(d.isva == '30'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">分公司采购经理通过</p>';
                        }else if(d.isva == '31'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">分公司采购经理不通过</p>';
                        }else if(d.isva == '40'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">分公司总经理通过</p>';
                        }else if(d.isva == '41'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">分公司总经理不通过</p>';
                        }else if(d.isva == '50'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">总公司销售经理通过</p>';
                        }else if(d.isva == '51'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">总公司销售经理不通过</p>';
                        }else if(d.isva == '60'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">总公司总经理通过</p>';
                        }else if(d.isva == '61'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">总公司总经理不通过</p>';
                        }else if(d.isva == '65'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">已提交退货申请</p>';
                        }else if(d.isva == '66'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">总公司总经理退货申请通过</p>';
                        }else if(d.isva == '67'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">总公司退货申请不通过</p>';
                        }else if(d.isva == '68'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">等待财务审核</p>';
                        }else if(d.isva == '80'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">分公司财务审核通过</p>';
                        }else if(d.isva == '81'){
                            return '<p class="layui-btn layui-btn-danger layui-btn-xs">分公司财务审核不通过</p>';
                        }else if(d.isva == '90'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">未入库</p>';
                        }else if(d.isva == '91'){
                            return '<p class="layui-btn layui-btn-warm layui-btn-xs">已入库</p>';
                        }
                  }}
                //, {field: 'sort', title: '排序', width: 140}
                , {field: 'reviewRemark', title: '审核说明', width: 120,align:"center"}
                , {field: 'auditor', title: '审核人', width: 160,align:"center"}
            ]]
            , page: true
            , id: 'test'
            ,where: {
                businessId:getQueryString("id")
            }
        });
    });


    /**
     得到地址栏的参数
     */
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
</script>
</body>
</html>